#!/bin/sh
clear
while true
do
	echo "欢迎使用cpptide 版本：1.1"
	echo "接下来要做什么？"
	echo "[1]创建/编辑一个项目"
        echo "[2]编译一个项目"
        echo "[3]运行一个项目"
        echo "[4]编译并运行一个项目"
	echo "[5]删除一个项目"
	echo "[6]更改编辑器设置"
        echo "[7]退出cpptide"
	read -p "请输入选项：" CHOOSE
	if [ "$CHOOSE" == "1" ]; then
		read -p "请输入项目名：" PROJECT1
		./edit $PROJECT1
		clear
	elif [ "$CHOOSE" == "2" ]; then
		read -p "请输入项目名：" PROJECT2
		g++ -o ./project/$PROJECT2 ./project/$PROJECT2/$PROJECT2.cpp
		clear
        elif [ "$CHOOSE" == "3" ]; then
                read -p "请输入项目名：" PROJECT3
		./project/$PROJECT3/$PROJECT3
		read -p "" STOP
		clear
        elif [ "$CHOOSE" == "4" ]; then
                read -p "请输入项目名：" PROJECT4
		./build_run ./project/$PROJECT4 $PROJECT4.cpp
		read -p "" STOP
		clear
        elif [ "$CHOOSE" == "5" ]; then
                read -p "请输入项目名：" PROJECT5
		rmdir ./project/$PROJECT5
		clear
        elif [ "$CHOOSE" == "6" ]; then
                vim ~/.vimrc
		clear
	#elif [ "$CHOOSE" == "7" ]; then
	else
		#read -p "你确定要退出吗？" EXIT
		#if [ "$EXIT" == "y" || "$EXIT" == "Y"]; then
		#	exit
		#fi
		clear
		exit
	fi
done
